function [Xpp_tf] = tfidf_rescaling(Xpp)

		tic;
		%fprintf('\n    * performing TF-IDF rescaling to matrix of size %s x %s\n    * ',currency(size(Xpp,1)),currency(size(Xpp,2)));
		%% TF %%
		Xpp_tf=spdiags(1./sum(Xpp,2),0,size(Xpp,1),size(Xpp,1))*Xpp; % normalize rows
		%% IDF %%
		Xpp_idf=log(size(Xpp,1)./(sum(Xpp>0)+1));
		%% TF-IDF %%
		for i=1:size(Xpp_tf, 2)
			Xpp_tf(:,i)=Xpp_tf(:,i)*Xpp_idf(i);
		end
		toc;
		fprintf('\n');
